package com.team.databoard.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.team.databoard.util.DatabaseUtils;
import lombok.Data;

/**
 * @TableName student
 */
@TableName(value = "student")
@Data
public class Student implements Serializable {
    /**
     * 学号
     */
    @ExcelIgnore
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 姓名
     */
    @ExcelProperty(value = "姓名")
    private String name;

    /**
     * 性别
     */
    @ExcelProperty(value = "性别", converter = DatabaseUtils.SexConverter.class)
    private Integer sex;

    /**
     * 省份
     */
    @ExcelProperty(value = "省份", converter = DatabaseUtils.ProvinceConverter.class)
    private Integer province;

    /**
     * 生日
     */
    @ExcelProperty(value = "生日")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birthday;

    /**
     * 身高
     */
    @ExcelProperty(value = "身高")
    private Integer height;

    /**
     * 学历
     */
    @ExcelProperty(value = "学历", converter = DatabaseUtils.EducationConverter.class)
    private Integer education;

    @Serial
    @ExcelIgnore
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}